package org.tjc.net.manager;

import org.tjc.net.manager.config.json.ConfLoader;
import org.tjc.net.manager.config.json.Configuration;
import org.tjc.net.manager.config.json.NgMainModule;

import java.io.File;

/**
 * @Author: tjc
 * @description
 * @Date Created in 18:15 2020-12-12
 */
public class Bootstrap {
    public static void main(String[] args) {
        if (args.length < 1) {
            System.out.println("conf path can not be null.");
            System.exit(1);
        }
        final String path = args[0];
        Configuration conf = Configuration.from(new File(path));
        ConfLoader loader = new ConfLoader(conf);

        NgMainModule context = loader.parse();
        context.init();
        Engine engine = new Engine(context);
        engine.start();
    }
}
